Recently, a semiconductor memory has been developed in which memory cells are stacked (e.g., BiCS: Bit Cost Scalable Flash Memory). With such a configuration, a semiconductor memory having a large capacity may be realized at low cost.